#pragma once
#include <iostream>
#include <string>
#include <vector>

//namespace CL
class Client
{
public:

    Client();
    ~Client();

    void close();
    void send(const std::string& str);
    std::string read();
    void connect(std::string_view ip, unsigned short port);
    void StartClient(std::string_view ip,unsigned short port);
    void sendmes();
    std::string sendFrame(uint8_t commandCode, uint8_t switchID, uint8_t switchState)const;
    std::vector<char> frameMes(uint8_t commandCode, uint8_t switchID, uint8_t switchState)const;
private:
    struct mes;
    struct Impl;
    struct mesHead;
    struct mesBody;
    std::unique_ptr<Impl> cimpl;
};





